
import numpy as np
import random
import matplotlib.pyplot as plt
#x改成无约束形式及0-无穷

d13=24212.959
s13=2698.573
y13=[]
#x11=np.arange(38,2679,2.641)
x13=np.arange(0,35000,35)  

d23=16166.928
s23=3644.241
y23=[]
#x12=np.arange(820,2880,2.06)
x23=np.arange(0,35000,35)   


 

for j in range(0,1000):
    if abs(d13-x13[j])>2*s13 :
        y13.append(0)
    else :
        y13.append(1-((x13[j]-d13)/(2*s13))**2)   
        
for j in range(0,1000):
    if abs(d23-x23[j])>2*s23 :
        y23.append(0)
    else :
        y23.append(1-((x23[j]-d23)/(2*s23))**2)   



plt.rcParams['font.sans-serif']=['STSong']     # 中文宋体
plt.rcParams['font.size'] = '15' # 设置字体大小 

plt.figure('area db_1', figsize=(8, 8))
plt.plot(x13,y13, color='green', label="$y^1(x_3)$")
plt.plot(x23,y23, color='red', label='$y^2(x_3)$',linestyle="--")
plt.legend()
plt.xlabel("对比度",fontsize=20)
plt.ylabel("$y$",fontsize=20)
plt.grid(linestyle=":", color="black")
plt.show()  #绘制图像



